package Review2;

public class Test11 {
     public double power(double base,int exponent){
    	 if(equal(base,0.0)&&exponent<0){
    		 
    	 }
    	 int absExponent = exponent;
    	 if(exponent<0){
    		 absExponent = -exponent;
    	 }
    	 double result=1.0;
    	 for(int i=1;i<=absExponent;i++){
    		 result*=base;
    	 }
    	 if(exponent<0){
    		 result=1.0/result;
    	 }
    	 return result;
    	 
     }
     public boolean equal(double num1,double num2){
    	 if(num1-num2<0.00000001&&num1-num2<-0.00000001){
    		 return true;
    	 }
    	 return false;
     }
}
